﻿/// <summary>
/// https://leetcode-cn.com/problems/remove-element/
/// </summary>
public class Solution
{
    public int RemoveElement(int[] nums, int val)
    {
        var result = nums.Where(item => item != val).ToArray();
        Array.Copy(result, nums, result.Length);
        return result.Length;
    }
}